Skip to content

Commit

Permalink
Add migrations. Add env var.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquingx committed Oct 9, 2023
1 parent ea42dbb commit 48c1ef8
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 2 deletions.
36 changes: 36 additions & 0 deletions estela-api/core/migrations/0033_auto_20230814_2238.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Generated by Django 3.1.14 on 2023-08-14 22:38

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("core", "0032_project_framework"),
]

operations = [
migrations.AddField(
model_name="spiderjobenvvar",
name="project",
field=models.ForeignKey(
help_text="Project pid.",
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="env_vars",
to="core.project",
),
),
migrations.AddField(
model_name="spiderjobenvvar",
name="spider",
field=models.ForeignKey(
help_text="Spider sid.",
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="env_vars",
to="core.spider",
),
),
]

40 changes: 40 additions & 0 deletions estela-api/core/migrations/0034_proxy_provider.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Generated by Django 3.1.14 on 2023-10-09 17:37

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('core', '0033_auto_20230814_2238'),
]

operations = [
migrations.CreateModel(
name='ProxyProvider',
fields=[
('proxyid', models.AutoField(help_text='A unique integer value identifying this proxy.', primary_key=True, serialize=False)),
('username', models.CharField(help_text='The username for the proxy', max_length=255)),
('password', models.CharField(help_text='The password for the proxy', max_length=255)),
('host', models.CharField(help_text='The host for the proxy', max_length=255)),
('port', models.CharField(help_text='The port for the proxy', max_length=5)),
('name', models.CharField(help_text='A name to identify the proxy', max_length=255)),
('description', models.CharField(help_text='A description for the proxy', max_length=1000)),
],
),
migrations.AddField(
model_name='spiderjob',
name='proxy_usage_data',
field=models.JSONField(default=dict, help_text='Proxy Usage data.'),
),
migrations.AddField(
model_name='usagerecord',
name='datacenter_proxy_usage',
field=models.PositiveBigIntegerField(default=0, help_text='Amount in bytes occupied by datacenter proxy responses in the database'),
),
migrations.AddField(
model_name='usagerecord',
name='residential_proxy_usage',
field=models.PositiveBigIntegerField(default=0, help_text='Amount in bytes occupied by residential proxy responses in the database'),
),
]
1 change: 1 addition & 0 deletions estela-web/.env.development.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
REACT_APP_API_BASE_URL=http://localhost:8000
REGISTER_PAGE_ENABLED=true
ESTELA_PROXIES="Estela Proxy"
4 changes: 2 additions & 2 deletions estela-web/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const API_BASE_URL = process.env.REACT_APP_API_BASE_URL;
export const ESTELA_PROXIES = process.env.ESTELA_PROXIES;
export const REGISTER_PAGE_ENABLED = process.env.REGISTER_PAGE_ENABLED === "true";
export const ESTELA_PROXIES = process.env.ESTELA_PROXIES ? process.env.ESTELA_PROXIES : "Estela Proxy";
export const REGISTER_PAGE_ENABLED = process.env.REGISTER_PAGE_ENABLED === "true";

0 comments on commit 48c1ef8

Please sign in to comment.